<div class="page_layout_container">
    {% if user.is_authenticated and user.is_active and user == album.owner %}
        <a class="album_remove_page_link" onclick="return askConfirmation();" href="{% url remove_page page.album.id page.id%}?page={{ page_num }}">X</a>
    {% endif %}
    <h2>{{page.caption}}</h2>
	<p>{{page.description}}</p>
	<div class="page_layout_image_container">
	{% block layout_content %}
        <div class="single">
        {% with picture=page.picture_set.all|first %}
            {% if picture %}
            {% include 'picture_block.html' with picture=picture page=page %}
            {% else %}
            {% include 'no_pictures_block.html' with page=page %}
            {% endif %}
        {% endwith %}
        </div>
    {% endblock %}
	</div>
</div>

<script type="text/javascript">
    function askConfirmation() {
        return confirm("Delete page from album?");
    }
</script>
